﻿Imports System.ServiceModel.Channels
Imports System.ServiceModel.Description
Imports System.ServiceModel.Dispatcher


''' <summary>
''' Adds the singleton instance of <see cref="CookieManagerMessageInspector"/> to an endpoint on the client.
''' </summary>
Public Class CookieManagerEndpointBehavior
    Implements IEndpointBehavior
    Public Sub AddBindingParameters(endpoint As ServiceEndpoint, bindingParameters As BindingParameterCollection) Implements IEndpointBehavior.AddBindingParameters
        Return
    End Sub

    ''' <summary>
    ''' Adds the singleton of the <see cref="ClientIdentityMessageInspector"/> class to the client endpoint's message inspectors.
    ''' </summary>
    ''' <param name="endpoint">The endpoint that is to be customized.</param>
    ''' <param name="clientRuntime">The client runtime to be customized.</param>
    Public Sub ApplyClientBehavior(endpoint As ServiceEndpoint, clientRuntime As ClientRuntime) Implements IEndpointBehavior.ApplyClientBehavior
        clientRuntime.MessageInspectors.Add(CookieManagerMessageInspector.Instance)
    End Sub

    Public Sub ApplyDispatchBehavior(endpoint As ServiceEndpoint, endpointDispatcher As EndpointDispatcher) Implements IEndpointBehavior.ApplyDispatchBehavior
        Return
    End Sub

    Public Sub Validate(endpoint As ServiceEndpoint) Implements IEndpointBehavior.Validate
        Return
    End Sub
End Class
